console.log('mysql connecting...');
var http=require('http');
var mysql =require('mysql');
console.log('loging...');
var connection=mysql.createConnection({
    host:'119.23.182.180',
    user:'srp',
    password:'srp',
    database:'mymess',
    port:3306
});

http.createServer((req,res)=>{
    connection.query("update vmessage set ip = '0.0.0.0' where id = 33 ")
    connection.query('select * from vmessage;',(error,rows,fields)=>{
        res.writeHead(200,{'Content-Type':'text/html;charset=utf8'});
        rows.forEach((row)=>{
            res.write(JSON.stringify(row)+'<br>')
        })
    })

}).listen(6868);